package com.issoft.studentresitor.service;

import com.issoft.studentresitor.domain.pojo.Result;
import com.issoft.studentresitor.domain.pojo.Student;
import com.baomidou.mybatisplus.extension.service.IService;
import com.issoft.studentresitor.domain.query.StudentQueryParam;
import com.issoft.studentresitor.domain.vo.StudentVo;
import com.issoft.studentresitor.utils.PageResult;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author GJH
 * @since 2025-09-14
 */
public interface IStudentService extends IService<Student> {
    /**
     * 查询学生分页
     * @param studentQueryParam
     * @return
     */
    PageResult<StudentVo> queryStuPage(StudentQueryParam studentQueryParam);
    /**
     * 批量导出
     * @param response
     * @return
     */
    Result export(HttpServletResponse response) throws IOException;
    /**
     * 查询没有选择班级的学生
     * @param
     * @return
     */
    List<StudentVo> queryNoClassStu();
    /**
     * 查询没有选择寝室的学生
     * @param
     * @return
     */
    List<Student> queryNoDromStu();
    /**
     * 根据user_id查询本班学生信息
     * @param userId
     * @return
     */
    List<Student> getByUIdQuerStudent(Integer userId);
    /**
     * 根据user_id查询本寝室学生信息
     * @param userId
     * @return
     */
    List<Student> queryDromStu(Integer userId);
    /**
     * 查询没有user_id的学生信息
     * @param
     * @return
     */
    List<Student> queryNoUserIdStu();
    /**
     * 添加user_id
     * @param id
     * @param userId
     * @return
     */
    int addUserId(Integer id, Integer userId);

    boolean updateStuInfo(@Param("userId") Integer userId,@Param("studentId") String studentId,@Param("sex") Integer sex,@Param("contactPhone") String contactPhone,@Param("emergencyContact") String emergencyContact,@Param("emergencyPhone") String emergencyPhone);

    int updateContact(Integer userId, String emergencyContact, String emergencyPhone, String contactPhone);

    void updateStuPhoto(Integer userId, String url);

    int updateInfo(Student student);
}
